import requests


headers = {
    "accept": "application/json, text/plain, */*",
    "accept-language": "zh-CN,zh;q=0.9",
    "priority": "u=1, i",
    "referer": "https://buyin.jinritemai.com/dashboard/data/financial/list",
    "sec-ch-ua": "\"Chromium\";v=\"140\", \"Not=A?Brand\";v=\"24\", \"Google Chrome\";v=\"140\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36"
}
cookies = {
    "passport_csrf_token": "29420573e5cd528c09c8ffdfd9d8560d",
    "passport_csrf_token_default": "29420573e5cd528c09c8ffdfd9d8560d",
    "is_staff_user": "false",
    "qc_tt_tag": "0",
    "buyin_shop_type": "11",
    "s_v_web_id": "verify_mhspcatm_FY2Hbq8p_Kr7f_4xKM_8qt3_x9p1VhAdb85o",
    "COMPASS_LUOPAN_DT": "session_7576206306727215366",
    "buyin_account_child_type": "1",
    "buyin_app_id": "13",
    "buyin_shop_type_v2": "11",
    "buyin_account_child_type_v2": "1",
    "buyin_app_id_v2": "13",
    "ucas_c0": "CkEKBTEuMC4wEJqIi97Tp4qSaRjmJiDkqqC2h8yfAiiwITDsxsCd_63gA0DB0pDJBkjBhs3LBlCbvNyU85fM_2hYbxIUn21bjDdpyxpfUm7Wka7fAZZWpFs",
    "ucas_c0_ss": "CkEKBTEuMC4wEJqIi97Tp4qSaRjmJiDkqqC2h8yfAiiwITDsxsCd_63gA0DB0pDJBkjBhs3LBlCbvNyU85fM_2hYbxIUn21bjDdpyxpfUm7Wka7fAZZWpFs",
    "PHPSESSID": "f6e5a54953b8bb7186ecf03320b7287e",
    "PHPSESSID_SS": "f6e5a54953b8bb7186ecf03320b7287e",
    "passport_mfa_token": "CjEkXOURiriUZhXQDkZudoNCj9o7VRXYwtpnc8Ts%2Be%2BbJ5gRsOkuIzSqtIrIhWiL8BkSGkoKPAAAAAAAAAAAAABPwJ4yBu9cGTNU2eS0ptN9A5Wlpx4sPVbKpU3u%2BoNh1o6hyMKPnEr8AnG5OmFd0YujHhDNuYIOGPax0WwgAiIBAwynlBY%3D",
    "passport_auth_status": "de235a562183447cd42618267583e8de%2C08e02b5b4ca25cabf2efa447ef0b91d6",
    "passport_auth_status_ss": "de235a562183447cd42618267583e8de%2C08e02b5b4ca25cabf2efa447ef0b91d6",
    "odin_tt": "9672e993ac0454f4b1820c4bf15ee5d037a181026f53711285e2b500df7c5298a19c3a32331d950f986ff92eed059358e280519654c69dcd3276423f0d012963",
    "op_session": "ec3f2e6db594988e3063645f17e3e809:561ae552b15bab8d7b87c03f51d86453abb1536039f3ada4a0ccd8527b88ac14",
    "ttwid": "1%7CCqe9vtPjUd-ToYjUy1mZGjePiF1FmmBDhTdxFk8X76o%7C1764207766%7C0581fb3e4392ff1f8a5dd77307383e3894ec507c342348ae2a3336d96ed685e1",
    "Hm_lvt_b6520b076191ab4b36812da4c90f7a5e": "1762391671,1762752314,1763973211,1764207775",
    "Hm_lpvt_b6520b076191ab4b36812da4c90f7a5e": "1764207775",
    "HMACCOUNT": "414D3F5B561355E7",
    "ucas_c0_buyin": "CkEKBTEuMC4wELSIkKS8k-uTaRjmJiDkqqC2h8yfAiiwITDsxsCd_63gA0Cf2Z7JBkifjdvLBlCbvNyU85fM_2hYbxIU-r9RWkF1wCdl23uowMjRif3QxlQ",
    "ucas_c0_ss_buyin": "CkEKBTEuMC4wELSIkKS8k-uTaRjmJiDkqqC2h8yfAiiwITDsxsCd_63gA0Cf2Z7JBkifjdvLBlCbvNyU85fM_2hYbxIU-r9RWkF1wCdl23uowMjRif3QxlQ",
    "sid_guard": "a2d4e322ea3cc52184edb3db2586b4d7%7C1764207775%7C5184000%7CMon%2C+26-Jan-2026+01%3A42%3A55+GMT",
    "uid_tt": "bd290ea87d3bc0b6c631d8215a0e7606",
    "uid_tt_ss": "bd290ea87d3bc0b6c631d8215a0e7606",
    "sid_tt": "a2d4e322ea3cc52184edb3db2586b4d7",
    "sessionid": "a2d4e322ea3cc52184edb3db2586b4d7",
    "sessionid_ss": "a2d4e322ea3cc52184edb3db2586b4d7",
    "session_tlb_tag": "sttt%7C1%7CotTjIuo8xSGE7bPbJYa01__________UYBHdrkElxpiU8_a3cQDtcAUbe5EZP28qEBMPJGDFmMo%3D",
    "session_tlb_tag_bk": "sttt%7C1%7CotTjIuo8xSGE7bPbJYa01__________UYBHdrkElxpiU8_a3cQDtcAUbe5EZP28qEBMPJGDFmMo%3D",
    "sid_ucp_v1": "1.0.0-KDM5ZjBhYTIwOTVmMTQ1MDNlZWQyYzA1ZGUzMTdjYWY0YWQ1ZjE1ZDkKFwjsxsCd_63gAxCf2Z7JBhiwITgCQPEHGgJscSIgYTJkNGUzMjJlYTNjYzUyMTg0ZWRiM2RiMjU4NmI0ZDc",
    "ssid_ucp_v1": "1.0.0-KDM5ZjBhYTIwOTVmMTQ1MDNlZWQyYzA1ZGUzMTdjYWY0YWQ1ZjE1ZDkKFwjsxsCd_63gAxCf2Z7JBhiwITgCQPEHGgJscSIgYTJkNGUzMjJlYTNjYzUyMTg0ZWRiM2RiMjU4NmI0ZDc",
    "SASID": "SID2_7577213713135157519",
    "BUYIN_SASID": "SID2_7577213713135157519",
    "gfkadpd": "2631,22740",
    "_tea_utm_cache_3813": "undefined",
    "scmVer": "1.0.1.9575",
    "csrf_session_id": "679683e6dd8994998f7e7816d585062c"
}
url = "https://buyin.jinritemai.com/api/dataBoard/getShopOrderList"
params = {
    "ewid": "7ba8c44c4feebc7be2d8a0f6373d0a4b",
    "time_type": "pay_success",
    "media_type_group": "-1",
    "traffic_source": "0",
    "page": "1",
    "pageSize": "20",
    "start_day": "2025/11/04 00:00:00",
    "end_day": "2025/11/11 23:59:59",
    "query_order_type": "0",
    "verifyFp": "verify_mhsu1xgq_KgD6SusI_SCHE_4Czf_Bq8T_RgdmmzK9oZd5",
    "fp": "verify_mhsu1xgq_KgD6SusI_SCHE_4Czf_Bq8T_RgdmmzK9oZd5",
    "msToken": "tZ-rDoGHbMsEQlAGSlxP-j3SQaromCM1dEpyAfUxOrbLFWdKec0BmZmg0Vxzm4l6VDtCUHOZyKQ75G-ED5vbCPUeYJGlTt1fTPyGgOo44uyhQ_TKGpPO8JyhoeOw1ZVtR5hAy57_lIH2WJ7mhPeaJ8QQAS4XpNh1irt945dPWWBE",
    "a_bogus": "DvsfDtXiExAfaplGmCDqSl3UGzVMNB8y3qTdRx3TtFziOqzcj2piMaGMcoqh2d2D2WMaild7cns/Tjncz9kTZ99pKmZfuhGRL4VAVhfL0qNRGMJQEHm8Czfzzw0nUcGqaQ5Gi1R60Ur96VVAwrd8/QAy9KoC5bWBM1OWkZzcY9BgZF6AD1c-PdtgOhJqRj=="
}
response = requests.get(url, headers=headers, cookies=cookies, params=params)

body = response.json()
data = body['data']
for info in data:
    order_id = info['order_id'] #订单id
    product_name = info['product_name'] #商品名称
    product_id = info['product_id'] #商品id        {商品信息=商品名称+商品id}
    cos_ratio_type_name = info['cos_ratio_type_name'] #佣金类型
    media_type_group_name = info['media_type_group_name'] #流量渠道
    traffic_source = info['traffic_source'] #流量细分渠道
    user_name = info['user_name'] #作者账号
    total_amount = info['total_amount'] #订单佣金  注意：数据是整数 没有小数点 29.9元显示为2990  
    cos_ratio = info['cos_ratio'] #佣金率  注意：数据是整数 没有小数点 10%显示为1000
    ideal_cos_fee = info['ideal_cos_fee'] #预计佣金支出  注意：数据是整数 没有小数点 2.99元显示为299
    pay_time = info['pay_time'] #订单时间_付款
    json_data = {
        "订单id": order_id,
        "商品名称": product_name,
        "商品id": product_id,
        "佣金类型": cos_ratio_type_name,
        "流量渠道": media_type_group_name,
        "流量细分渠道": traffic_source,
        "作者账号": user_name,
        "订单佣金": total_amount,
        "佣金率": cos_ratio,
        "预计佣金支出": ideal_cos_fee,
        "订单时间_付款": pay_time
    }
    print(json_data)